<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=gbk">
		<link href="css/style.css" rel="stylesheet" type="text/css">
		<title>维护所有的用户</title>
		<script type="text/javascript">
	var link;
	function userAction(link) {
		var d = document.forms[0];
		d.action = link;
		d.submit();
	}

	function userActionDel(link) {
		if (window.confirm("确认删除吗？")) {
			var d = document.forms[0];
			d.action = link;
			d.submit();
		} else {

		}
	}
</script>
	</head>
	<body>
		<center>
			<h2>
				维护所有的用户
			</h2>
		</center>
		<div align="center">
			<form action="#" method="post">
				<table border="1" width="80%">
					<tr>
						<th>
							用户名
						</th>
						<th>
							密码
						</th>
						<th>
							修改
						</th>
						<th>
							删除
						</th>
					</tr>
					<s:iterator value="#request.userList" id="user">
						<tr>
							<td>
								<s:property value="#user.name" />
							</td>
							<td>
								<s:property value="#user.password" />
							</td>
							<td>
								<!-- input type="image" src="images/modify_page.png"
									onClick="userAction('pages/update.jsp?userName=<s:property value="#user.name" />&password=<s:property value="#user.password" />')" /> -->
								<input type="button" value="修改" name="update" onclick="userAction('pages/update.jsp?userName=<s:property value="#user.name" />&password=<s:property value="#user.password" />')" />
							</td>
							<td>
								<!-- <input type="image" src="images/delete_page.png"
									onclick="userActionDel('delete?name=<s:property value="#user.name" />')" /> -->
								<input type="button" value="删除" name="delete" onclick="userActionDel('delete?name=<s:property value="#user.name" />')" />
							</td>
						</tr>
					</s:iterator>
				</table>
			</form>

		</div>
	</body>
</html>